package com.tt.mymu.controller;

import com.tt.mymu.service.UserViewService;
import com.tt.mymu.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("userView")
public class UserViewController {

    @Autowired
    private UserViewService userViewService;

    /**
     * 根据id修改当前用户时间， 1，个月月、2,3个月、3，半年
     *
     * @param id
     * @param status
     * @return
     */
    @PostMapping("updateUserViewEndTime")
    public Result updateUserViewEndTime(int id, int status) {
        return userViewService.updateUserViewEndTime(id, status);
    }

    @PostMapping("updateUserViewEndTimeById")
    public Result updateUserViewEndTimeById(int id, String endTime) {
        return userViewService.updateUserViewEndTimeById(id, endTime);
    }

}
